<?php /*a:1:{s:70:"D:\phpstudy_pro\WWW\sact\application\admin\view\accountnumber\add.html";i:1622451835;}*/ ?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>add</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
</head>
<body>

  <div class="layui-form" style="padding: 20px 0 0 0;">
    <form id="formadd" method="post" action="">

    <div class="layui-form-item">
      <label class="layui-form-label">用户名</label>
      <div class="layui-input-inline" style="width: 300px">
        <input type="text" name="username" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
      </div>
    </div>

      <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline" style="width: 300px">
          <input type="text" name="password" lay-verify="required" placeholder="请输入密码 密码将加密 请牢记您的密码" autocomplete="off" class="layui-input">
        </div>
      </div>

    <div class="layui-form-item">
      <label class="layui-form-label">用户状态</label>
      <div class="layui-input-block">
        <input type="radio" name="status" value="0" title="正常使用" checked="">
        <input type="radio" name="status" value="1" title="将被禁用" disabled="true">
      </div>
    </div>

    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" lay-submit="" lay-filter="component-form-element">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
      </div>
    </div>

    </form>
  </div>

  <script src="../../../layuiadmin/layui/layui.js"></script>
  <script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
  <script>
    layui.use(['form', 'layer', 'upload'], function () {
      $ = layui.jquery;
      form = layui.form;
      upload = layui.upload;
      layer = layui.layer;


    })


  $(function () {
    $("#formadd").submit(function (e) {
      e.preventDefault();
      var data = $(this).serialize();

      $.ajax({
        type: "post",
        url: "<?php echo url('admin/Accountnumber/adduser'); ?>",
        data: data,
        success: function (res) {
          if (res.code == 200) {
            layer.msg('添加成功', { icon: 6, time: 1000 }, function () {
              parent.location.reload();
            });
          } else {
            layer.msg('添加失败', { icon: 5, time: 1000 })
          }
        },
        error: function (res) {
        }
      });
    });
  });

  </script>
</body>
</html>